import java.awt.Point;

/* Ori Perl
 * 10/21/10
 * Software Design pd. 8
 * Holds information for the calculators location and color.
 * */
public class Calculator {
	int color;//color is also how many points * 100, 1 is red, 2 is black; 3 is silver;
	//width and height of the calculator image.
	static int width = 64;
	static int height = 64;
	Point topR;
	Point botL;
	boolean isHit = false;
	
	public Calculator(){
		color = 0;
		topR = new Point();
		botL = new Point();
	}//end default constructor
	public Calculator(Point t, int c){
		color = c;
		topR = new Point((int)t.getX()+width,(int)t.getY());
		botL = new Point((int)t.getX(),(int)t.getY()+height);
	}//end default constructor
	//setter
	//move the calculator in time and position
	public void move(int move){
		if (!isHit){
			topR.setLocation(topR.getX(), topR.getY()-move);
			botL.setLocation(botL.getX(), botL.getY()-move);
		}//end if
	}//end move
	//notifies the calculator that it got hit
	public void hit(){
		isHit = true;
	}//end hit
	//getters
	public int getColor(){
		return color;
	}//end get Color
	public boolean isHit(){
		return isHit;
	}//end is hit?
	public int getPoints(){
		return color*100;
	}// get color;
	public Point getTopRight(){
		return topR;
	}//end get top right
	public Point getBottomLeft(){
		return botL;
	}//end get top right
}//end class